import request from '@/utils/request'
const qs = require('qs')

// 客户分群列表
export function getCustomerGroupcodes(params) {
    return request({
      url: '/hermes/groupdefine/customer/groupcodes',
      method: 'get',
      params
    })
  }

// 债券分群列表
export function getBondGroupcodes(params) {
    return request({
      url: '/hermes/groupdefine/bond/groupcodes',
      method: 'get',
      params
    })
  }

// 客户分群信息
export function getCustomerGroupdefine(params) {
    return request({
      url: '/hermes/groupdefine/customer',
      method: 'get',
      params
    })
  }  

// 债券分群信息
export function getBondGroupdefine(params) {
    return request({
      url: '/hermes/groupdefine/bond',
      method: 'get',
      params
    })
  } 

// 客户分群成员明细
export function getCustomerGroupmember(params) {
    return request({
      url: '/hermes/groupdefine/customer/member',
      method: 'get',
      params
    })
  }

// 债券分群成员明细
export function getBondGroupmember(params) {
    return request({
      url: '/hermes/groupdefine/bond/member',
      method: 'get',
      params
    })
  }  

// 新增客户分群成员明细
export function addCustomerGroupmember(params) {
    return request({
      url: '/hermes/groupdefine/customer/member',
      headers: { 
        'Accept': '*/*', 
        'content-type': "application/x-www-form-urlencoded",
        'Connection': 'keep-alive' 
      },
      method: 'post',
      data: qs.stringify(params)
    })
  }

// 新增债券分群成员明细
export function addBondGroupmember(params) {
    return request({
      url: '/hermes/groupdefine/bond/member',
      headers: { 
        'Accept': '*/*', 
        'content-type': "application/x-www-form-urlencoded",
        'Connection': 'keep-alive' 
      },
      method: 'post',
      data: qs.stringify(params)
    })
  }  

// 删除客户分群成员明细
export function deleteCustomerGroupmember(params) {
    return request({
      url: '/hermes/groupdefine/customer/member',
      headers: { 
        'Accept': '*/*', 
        'content-type': "application/json",
        'Connection': 'keep-alive' 
      },
      method: 'delete',
      data: params
    })
  }

// 删除债券分群成员明细
export function deleteBondGroupmember(params) {
    return request({
      url: '/hermes/groupdefine/bond/member',
      headers: { 
        'Accept': '*/*', 
        'content-type': "application/json",
        'Connection': 'keep-alive' 
      },
      method: 'delete',
      data: params
    })
  }

// 债券信息查询
export function getBondcommon(params) {
    return request({
      url: '/hermes/common/bond',
      method: 'get',
      params
    })
  } 

// 客户信息查询
export function getCustomercommon(params) {
    return request({
      url: '/hermes/common/customer',
      method: 'get',
      params
    })
  }            